<?php
// 引入公共文件
include_once('./config/config.php');
// 引入数据库配置文件
include_once('./config/check.php');

// 获取部门 ID
$depid = isset($_GET['depid']) ? intval($_GET['depid']) : 0;

if ($depid > 0) {
    // 查询对应部门的职位信息
    $jobsql = "SELECT * FROM per_job WHERE depid = $depid";
    $jobres = all($jobsql);
    echo json_encode($jobres);
} else {
    echo json_encode([]);
}
?>